5 ONERRORGOTO1000 10 MODE8:DIM:x=2:c$=CHR$(5) 20 CLS:PRINT"Prime factors (2óBase<10Çø)";:a$=" *" 40 LOCATE0,1:PRINTc$;"Base ?";:INPUT@11;x:LOCATE0,0 45 IFx<2 ORx>=1e10 ORFRACx<>0 THEN40 50 LOCATE0,1:PRINTc$;x;"= ....."; 60 u=0:v=0:n=1:t$="":a=x 70 GOTO130 100 u=2:GOSUB500 110 a=a/2 120 IFa-1=0 THEN240 130 IFFRAC(a/2)=0 THEN100 140 b=3 150 c=SQRa+1 160 IFb>=c THEN230 170 IFFRAC(a/b)=0 THEN190 180 b=b+2:GOTO160 190 IFa/b*b-a=0 THEN210 200 GOTO180 210 u=b:GOSUB500 220 a=a/b:GOTO150 230 u=a:GOSUB500 240 a$="":GOSUB530 250 PRINTc$;x;"=";t$;:z$=INPUT$(1,@):GOTO20 500 IFv=u THENn=n+1:GOTO550 520 IFv=0 THEN550 530 IFn>1 THENt$=t$+STR$(v)+"^"+MID$(STR$(n),2)+a$ ELSEt$=t$+STR$(v)+a$ 540 n=1 550 v=u:RETURN 1000 IFERR=1 THENCLS:ONERRORGOTO0 1010 IFERL=40 THENRESUME40 1050 LOCATE0,1:PRINTc$;"not found";:z$=INPUT$(1,@):RESUME20